<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" class="no-js">

    <head>
		 <base href="<%=basePath%>">
        <meta charset="utf-8">
        <title>Library Login</title>
       
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <!-- CSS -->
        <link rel='stylesheet' href='http://fonts.googleapis.com/css?family=PT+Sans:400,700'>
        <link rel="stylesheet" href="assets/css/reset.css">
        <link rel="stylesheet" href="assets/css/supersized.css">
        <link rel="stylesheet" href="assets/css/style.css">
        <script type="text/javascript" src="assets/js/jquery-1.8.2.min.js"></script>
		<script type="text/javascript">
/**
 * 验证code-js
 */
 
// 点击换一张验证码
function changeImg() {
	var imgSrc = $("#imgObj");
	var src = imgSrc.attr("src");
	imgSrc.attr("src", chgUrl(src));
	$("#info").html("");
}
// 时间戳
// 为了使每次生成图片不一致，即不让浏览器读缓存，所以需要加上时间戳
function chgUrl(url) {
	var timestamp = (new Date()).valueOf();
	url = url.substring(0, 17);
	if ((url.indexOf("&") >= 0)) {
		url = url + "×tamp=" + timestamp;
	} else {
		url = url + "?timestamp=" + timestamp;
	}
	return url;
}
// 验证码验证
function isRightCode(form) {
	if (form.name.value==""){
		alert("请输入管理员名称!");form.name.focus();return false;
	}
	else if (form.pwd.value==""){
		alert("请输入密码!");form.pwd.focus();return false;
	}
	else if (form.veryCode.value==""){
		alert("请输入验证码!");form.pwd.focus();return false;
	}
}
</script>
        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->

    </head>

    <body>

        <div class="page-container">
            <h1>图书馆管理系统</h1>
            <form action="manager.do?action=login" name="form1" method="post">
                <input type="text" name="name" class="logininput" id="name" placeholder="Username">
                <input name="pwd" type="password" class="logininput" id="pwd" placeholder="Password">
                <div style="width:300px;height:42px;margin:0 auto;margin-top: 20px">
                    <input class="yanzheng" style=" margin-top: 0px;width: 120px;float:left;" name="veryCode" type="text" value="" onmouseout="isRightCode()" placeholder="VerifyCode"/>
                	<img id="imgObj" alt="" src="DrewImage" onclick="changeImg()"  style="float:left;width: 100px;display:inline-block;height: 42px;margin-left: 30px;"/>
                </div>
      
               <!-- 
                 
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="100"> </td>
			
			<td width="150">
				<input id="veryCode" name="veryCode" type="text" class="yzm" value="" placeholder="VerifyCode"/></td>
			<td width="50" height="37" style="padding-left:325px;"><img id="imgObj" alt="" src="DrewImage"
				onclick="changeImg()" /></td>
			<td><a href="#" onclick="changeImg()">换一张</a></td>
			<td></td>
		</tr>
		<tr>
			<td style="line-height: 38px; color: #FF0000; text-align: center;" colspan="4" id="info"> </td>
			<td></td>
		</tr>
	</table> -->
                <button name="Submit" type="submit" class="btn_grey" value="确定" onClick="isRightCode(form1)">Sign me in</button>
                <div class="error"><span>+</span></div>
            </form>
            
        </div>
        

        <!-- Javascript -->
        <script src="assets/js/jquery-1.8.2.min.js"></script>
        <script src="assets/js/supersized.3.2.7.min.js"></script>
        <script src="assets/js/supersized-init.js"></script>
        <script src="assets/js/scripts.js"></script>
        
    </body>

</html>
